package blog.spring.db.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import blog.spring.db.dao.IUserDAO;
import blog.spring.db.entity.User;

@Repository("userDao")
public class UserDAO extends BaseDAO<User> implements IUserDAO {

	@Override
	public User selectByName(String name) {
		return super.selectByName("userName", name);
	}

	@Override
	public User login(String username, String password) {
		Map<String, Object> conditions = new HashMap<String, Object>();
		conditions.put("userName", username);
		conditions.put("passWord", password);
		return super.searchUnique(conditions, false);
	}


}
